package com.manager.car.action;

import java.util.List;

import com.manager.car.po.DemandInfo;
import com.manager.car.po.DepartmentInfo;
import com.manager.car.service.IDepartmentInfoService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class DepartmentInfoAction extends ActionSupport{
	
	private static final long serialVersionUID = 1L;
    private IDepartmentInfoService departmentInfoService; 
    private DepartmentInfo dti;
    private Integer id;
    
    public String queryAll() {
    	List<DepartmentInfo> list = departmentInfoService.queryAll();
    	ActionContext.getContext().put("list", list);
		return "list";
    }
    public String add() {
    	departmentInfoService.add(dti);
    	return "add";
    }
    public String queryId() {
    	DepartmentInfo departmentInfo = departmentInfoService.queryId(id);
    	ActionContext.getContext().put("queryId", departmentInfo);
    	return "queryId";
    }
    public String edit() {
    	departmentInfoService.update(dti);
    	return "edit";
    }
    public String delete() {
    	departmentInfoService.delete(id);
    	return "delete";
    }
	public IDepartmentInfoService getDepartmentInfoService() {
		return departmentInfoService;
	}
	public void setDepartmentInfoService(IDepartmentInfoService departmentInfoService) {
		this.departmentInfoService = departmentInfoService;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public DepartmentInfo getDti() {
		return dti;
	}
	public void setDti(DepartmentInfo dti) {
		this.dti = dti;
	}
}
